package com.sys.manage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.sys.api.Controller.OrderManagerController;
import com.sys.api.Service.OrderManagerService;
import com.sys.common.ZuelResult;
import com.sys.vo.OrderAll;
import com.sys.vo.OrderResponse;
import com.sys.vo.OrdersList;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/managerfunction")
public class OrderManagerControllerImpl  implements OrderManagerController{

	@Autowired
	private OrderManagerService service;
	
	@Override
	@PostMapping("/response")
	@ApiOperation(value="回复用户",notes="传订单id，自己的id，以及内容")
	public ZuelResult responseOrder(@RequestBody OrderResponse res) {
		// TODO Auto-generated method stub
		return service.responseOrder(res);
	}

	@GetMapping("/getorder")
	@ApiOperation(value="获得订单现状,1是用户,2是客服",notes="传订单id")
	@Override
	public OrderAll getAllOrder(@RequestParam int id) {
		// TODO Auto-generated method stub
		return service.getAllOrder(id);
	}

	@GetMapping("/getorderlist")
	@ApiOperation(value="查看该客服可处理的所有订单",notes="传自己的客服id")
	@Override
	public OrdersList getOrdersList() {
		// TODO Auto-generated method stub
		return service.getOrdersList();
	}

}
